﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class UserBackGround_CheckInfo : System.Web.UI.Page
{
    Operation operation = new Operation(); //业务类对象
    static string userid;　　　　　 //供求信息类型
    //DataSet dsCheckInfo = null;
    //static int CheckType = -1;　　　　　　　//3种类别：全部显示(-1代表全部显示)，显示未审核（0），显示审核(1)

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["userid"] == null)
                Response.Write("<script language=javascript>alert('会话失效，请重新登录！');</script>");
            else
            {
                userid = Session["userid"].ToString();
            }
        }
    }
    protected void mdfy_Click(object sender, EventArgs e)
    {
        if (operation.SelectUserInfo(userid).Tables[0].Rows[0][2].ToString() == oldpwd.Text.Trim())
        {
            operation.UpdateUserPwd(password.Text.Trim(), userid);
            Response.Write("<script language=javascript>alert('修改成功！');</script>");
        }
        else
        {
            Response.Write("<script language=javascript>alert('旧密码输入错误！');</script>");
        }
    }
}